TARGET = libxmlparse.so

########## set up compiler environment
CFLAGS += -fPIC
CFLAGS += -I.

####### Files
SRC = $(wildcard *.c)
HEADERS = $(wildcard *.h)
COBJS = $(patsubst %.c, %.o, $(SRC))

all: $(TARGET)
	cp $(TARGET) $(XML_LIB_DIR)
	cp $(HEADERS) $(XML_INC_DIR)
	@echo "###################################"
	@echo "#        $(TARGET) "
	@echo "#        Build up successfully"
	@echo "###################################"		

	
$(TARGET): $(COBJS)
	$(CC) $(CFLAGS) -shared $(COBJS) -o $@  $(LDFLAGS)
	
%.o:%.c
	$(CC) $(CFLAGS) -c -o $@ $<

clean:
	@echo "###################################"
	@echo "#        clean $(TARGET) "
	@echo "###################################"		
	rm -f $(COBJS) $(TARGET)

